<%@ page import="org.apache.solr.core.SolrCore"%>
<%@ page import="org.apache.solr.core.CoreContainer"%>
<%@ page import="java.util.Collection"%>
<html>
<head>
<link rel="icon" href="/admin/favicon.ico" type="image/ico" />
<link rel="shortcut icon" href="/admin/favicon.ico" type="image/ico" />
<style type="text/css">
.top {
	position: relative;
}

.top .left {
	position: relative;
	float: left;
	width: 142px;
}

.top .right {
	position: relative;
	float: left;
	padding-bottom: 0px;
	line-height: 78px;
	height: 78px;
}
.clear {clear: both;}
</style>
<title>Welcome to Solr</title>
</head>
<body>
	<div class="top">
		<div class="left">
			<a href="."><img src="/admin/img/solr.png" border="0" alt="Solr" /></a>
		</div>
		<div class="right">
			<h1>Welcome to Solr!</h1>
		</div>
	</div>
	<div class="clear">&nbsp;</div>
	<div>
		<div><a href="#/">Solr Admin</a></div>
		<%
		CoreContainer coreContainer = (CoreContainer)request.getAttribute("org.apache.solr.CoreContainer");
		if(coreContainer != null) {
			Collection<SolrCore> solrCores = coreContainer.getCores();
			if(solrCores != null && solrCores.size() > 0) {
				for(SolrCore core : solrCores) {
					String coreName = core.getName();
					if("".equals(coreName)) coreName = ".";
		%>
		<div><a href="#/<%=coreName %>/">Admin <%=core.getName() %></a></div>
		<%
				}
			}
		}
		%>
	</div>
</body>
</html>
